<?php

namespace CMBUBank\UBank\Request\TransManager;

use CMBUBank\Http\RequestParameter;
use CMBUBank\UBank\Request\UBankBaseRequest;
use CMBUBank\UBank\Response\TransManager\TransManagerCreateSubunitResponse;
use CMBUBank\UBank\Response\TransManager\TransManagerSubunitListResponse;

class TransManageSubunitListRequest extends UBankBaseRequest
{
    protected $code = 'NTDUMQRY';

    protected $response = TransManagerSubunitListResponse::class;

    protected $logTip = '记账子单元查询';

    private $backNo;

    private $account;

    private $beginSubCode;

    private $endSubCode;

    private $page;

    public function generate(): array
    {
        return [
            'ntdumqryy1' => [[
                'bbknbr' => $this->backNo,
                'inbacc' => $this->account,
                'danbeg' => $this->beginSubCode ?: '********************',
                'danend' => $this->endSubCode ?:'********************',
                'ctnkey' => $this->page
            ]],
        ];
    }

    public function setBackNo(string $backNo): void
    {
        $this->backNo = $backNo;
    }

    public function setAccount(string $account): void
    {
        $this->account = $account;
    }

    public function setBeginSubCode(string $beginSubCode): void
    {
        $this->beginSubCode = $beginSubCode;
    }

    public function setEndSubCode(string $endSubCode): void
    {
        $this->endSubCode = $endSubCode;
    }

    public function setPage(string  $page): void
    {
        $this->page = $page;
    }
}